<%@ page contentType="text/html; charset=utf-8" language="java" %>
<%@ include file="/sys/include/header.jsp" %>

<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<head>
<title>添加店面成绩</title>
<style type="text/css">
body{
	margin:10px;  
	font-size:0.9em;
}
a{
	color:#F00;
}
.STYLE1 {color: #FF0000}
</style>
<!-- extjs -->
<link rel="stylesheet" type="text/css" href="sys/extjs/css/ext-all.css">
<script type="text/javascript" src="sys/extjs/js/ext-base.js"></script>
<script type="text/javascript" src="sys/extjs/js/ext-all.js"></script>
<link rel="stylesheet" type="text/css" href="sys/extjs/css/tables-example.css">	
<link href="sys/style01/css/table.css" rel="stylesheet" type="text/css" /> 
<link rel="stylesheet" href="sys/style01/css/tab-view.css" type="text/css" media="screen">
<link href="sys/style01/date/css/banzu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="sys/style01/date/include/js/calendar.js"></script>
<script type="text/javascript" src="sys/style01/date/include/js/checkdate.js"></script>
<script type="text/javascript" src="sys/style01/date/include/js/calendar-zh.js"></script>
<script type="text/javascript" src="sys/style01/date/include/js/calendar-setup.js"></script>
</head>
<SCRIPT src="sys/js/include/Calendar2.js"></SCRIPT>
<script type="text/javascript"> 
function checkFloat(String) { 
	var Letters = "1234567890."; 
	var i; 
	var c; 
	if(String.charAt(0) == '.'){
		return false;
	}
	for( i = 0; i < String.length; i ++ ){ 
		c = String.charAt( i ); 
		if (Letters.indexOf( c ) ==-1){ 
			return false; 
		} 
	} 
	var arrScore = String.split(".");
	if(arrScore.length > 2){
		return false;
	}
return true; 
}  

	function save(){
		if(document.form1.shop_name.value==""){
			alert("请选择店面");
			return;
		}
		if(document.form1.shop_totalScore.value==""){
			alert("请输入店面总成绩");
			return;
		}
		if(checkFloat(document.form1.shop_totalScore.value) == false){
			alert("店面总成绩格式错误");
			return;
		}
		if(document.form1.starttime.value==""){
			alert("请输入开始时间");
			return;
		}
		if(document.form1.endtime.value==""){
			alert("请输入结束时间");
			return;
		}	
		if(document.form1.endtime.value < document.form1.starttime.value){
			alert("结束时间必须大于等于开始时间");
			return;
		}
		if(document.form1.tufashijian_type.value == "6" && document.form1.qita_value.value ==""){
			alert("请注明其他");
			return;
		}
		if(document.form1.tufashijian_type.value == ""){
			alert("请填写突发事件");
			return;
		}
		document.form1.submit();
    }

    function selectTufashijian(value){
		if(value == "6"){
			document.getElementById("qita_value").style.display = "";
		}else{
			document.getElementById("qita_value").style.display = "none";
		}
    }

</script>
<body class="ridgeBody">
<table align="center" width="100%"><tr><td align="center">
<form name="form1" method="post" action="hr/shopScoreInsertDo.action"  >
	<table class=datatable width="100%" cellpadding='0' cellspacing='0' border='1' bordercolordark='white' bordercolorlight='#BEBEBE'>
	    <tr>
	        <td height="25" colspan="4" valign="top" class="dataTitle"><br>店面成绩</td>
	    </tr>	     
      <tr>        
        <td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>选择店面：</td>
        <td height="22" >
        <input name="shop_code"  type="hidden" class="input" readonly /> 
        	<input name="shop_name"  type="text" class="input" readonly /> 
        	<span style="color:red;cursor:hand;textDecoration:underline" onclick="window.open('../hr/queryShopListPopForScore.action')">查询</span> 
        </td>
         <td height="22" nowrap="nowrap" class="datatr1"><span class="STYLE1">*</span>店面总成绩：</td>
        <td height="22" >
        	<input name="shop_totalScore"  type="text" class="input"  /> 
        </td>
      </tr> 
     <tr>
     <td width="25%" height="22" valign="top" nowrap class="datatr1"><font color="#FF0000">*</font>开始日期：</td>
					<td valign="top" nowrap class="tabimputright">       
						<input name="starttime" type="text" class="input" onclick="setday(this)"  value="" readOnly/>
	    			</td>
     <td width="25%" height="22" valign="top" nowrap class="datatr1"><font color="#FF0000">*</font>结束日期：</td>
					<td valign="top" nowrap class="tabimputright">       
						<input name="endtime" type="text" class="input" onclick="setday(this)"  value="" readOnly/>
	    			</td>
     </tr>
     <tr>
     <td height="26" with="25%" nowrap="nowrap" class="datatr1"><span class="STYLE1" >*</span>突发事件：</td>
		<td height="26" with="25%">
			<select class="selectwidth" name="tufashijian_type" value="${tufashijian_type}" onChange="selectTufashijian(this.options[selectedIndex].value)">
				 <option value="" selected>请选择</option>
				<c:forEach items="${tufaList}" var="tufa">
					<option value="${tufa.commonCode}" <c:if test="${tufa.commonCode==tufashijian_type}">selected</c:if>>${tufa.commonValue}</option>	
				</c:forEach>
			</select>
			<input name="qita_value"  id = "qita_value" class="input" style="display:none"/> 
			
		</td>
		<td width="25%" height="22" valign="top" nowrap class="datatr1">&nbsp;</td>
					<td valign="top" nowrap class="tabimputright">&nbsp;</td>
		
     </tr>
</table>

<table width="100%" bgcolor="#96BDDA">
<tr>
<td height="20" colspan="6" valign="top" class="dataTitle">
<input type="button"  onClick="save()" value="保存">
<input type="reset"  onClick="" value="重置"></td>
</tr> 
</table>
<input type="hidden" name="flag">
</form>
</td></tr></table>
</body>
</html> 

